import request from "@/request/";

//分页
export const getList = (data) => {
  return request({
    url: "/api/mes-equipment-service/check/bill/page",
    method: "POST",
    data,
  });
};

// 获取详情
export const getDetail = (checkBillId) => {
  return request({
    url: "/api/mes-equipment-service/check/bill/detail",
    method: "POST",
    data: { checkBillId },
  });
};
//设备点检单审核列表
export const getDetailRight = (checkBillId) => {
  return request({
    url: "/api/mes-equipment-service/check/bill/audit/list",
    method: "POST",
    data: { checkBillId },
  });
};
// 点检项明细
export const getDetailInner = (checkDetailId) => {
  return request({
    url: "/api/mes-equipment-service/check/bill/detail/detail",
    method: "POST",
    data: { checkDetailId },
  });
};

// 获取可用数与库存数
export const getNumInfo = (data) => {
  return request({
    url: "/api/mes-equipment-service/misc-out-bill/detail/material-inv",
    method: "POST",
    data,
  });
};
//审核/驳回
export const getAudit = (data) => {
  return request({
    url: "/api/mes-equipment-service/check/bill/audit",
    method: "POST",
    data,
  });
};
// 新增
export const add = (data) => {
  return request({
    url: "/api/mes-equipment-service/misc-out-bill/save-or-update",
    method: "POST",
    data,
  });
};

// 删除
export const remove = (checkBillIdList) => {
  return request({
    url: "/api/mes-equipment-service/check/bill/cancel",
    method: "POST",
    data: { checkBillIdList },
  });
};

// 驳回
export const reject = (data) => {
  return request({
    url: "/api/mes-equipment-service/misc-out-bill/reject",
    method: "POST",
    data,
  });
};

// 确认
export const confirm = (id) => {
  return request({
    url: "/api/mes-equipment-service/misc-out-bill/confirm",
    method: "POST",
    data: { id },
  });
};

export const getEnum = (keyList) => {
  return request({
    url: "/api/mes-equipment-service/preset/enum/list",
    method: "POST",
    data: {
      keyList,
    },
  });
};

export const getFileList = (fileIdList) => {
  return request({
    url: "/api/mes-equipment-service/minio/attach/selectAttachByIdList",
    method: "POST",
    data: {
      fileIdList,
    },
  });
};
